﻿using System;

namespace Compoment
{
    class Program
    {
        static void Main(string[] args)
        {
            ConcreteCompany root = new ConcreteCompany("北京总公司");
            root.Add(new HRDepartment("总公司人力资源部"));
            root.Add(new FinanceDepartment("总公司财务部"));

            ConcreteCompany comp1 = new ConcreteCompany("上海分公司");
            comp1.Add(new HRDepartment("上海分公司人力资源部"));
            comp1.Add(new FinanceDepartment("上海分公司财务部"));
            root.Add(comp1);

            ConcreteCompany comp2 = new ConcreteCompany("深圳分公司");
            comp2.Add(new HRDepartment("深圳分公司人力资源部"));
            comp2.Add(new FinanceDepartment("深圳分公司财务部"));
            root.Add(comp2);

            Console.WriteLine("\n 结构图：");
            root.Display(1);

            Console.WriteLine("\n 职责：");
            root.LineOfDuty();

            Console.Read();

        }
    }
}
